<?php
/**
	PingCo PHP Framework
	Copyright (c) 2009 - 2010 Henter.

	描述:开发基于PingCo开放平台开发第三方应用
	Author:Henter 511589173@qq.com
*/
	
class Manage extends MOD{
	var $act = '';
	var $db = '';
	
	function __construct() 
	{
		global $db;
		global $table;
		$this->act = $act;
		$this->db = $db;
		$this->table = DB_PRE.$table;
	}

	function all($offset = 20, $pagesize = 1)
	{
		$page = intval($page);
		$pagesize = 15;
		$offset = ($page-1)*$pagesize;

		$offset = intval($offset);
		$pagesize = intval($pagesize);
		return $this->table;
		//return $this->db->select("SELECT * FROM $this->table WHERE 1 $this->sql ORDER BY adsid LIMIT $offset, $pagesize");
	}

	function page()
	{
		global $page;
		$page = $page ? intval($page) : 1;
		$pagesize = 20;
		$r = $this->db->get_one("SELECT COUNT(*) AS num FROM $this->table");
		$number=$r['num'];
		return pages($number, $page, $pagesize);
	}
}
?>